class Tool(object):
    # 定义类属性
    count = 0

    # 定义类方法的注解
    @classmethod
    def show_tool_count(cls):
        print("工具对象的数据 %d" % cls.count)

    def __init__(self, name):
        self.name = name

        # 让属性的值自增
        Tool.count += 1


tool1 = Tool("铁锹")
tool2 = Tool("榔头")
print(tool1.count)
print(tool2.count)
Tool.show_tool_count()
